//
//  AppConfig.swift
//  APP
//
//  Created by Rdxer on 2017/12/21.
//  Copyright © 2017年 Rdxer. All rights reserved.
//

import UIKit
import XXLogger

enum AppConfigEnum {
    case debug(isTestServer:Bool)
    case release(isTestServer:Bool)
}

class AppConfig:NSObject{
    
    static var current:AppConfigEnum = .release(isTestServer: false)
    
    static func initConfig(){
    XXLogger.xx_DefaultLogLevel = .e
///// 修改 配置
#if DEBUG
        current = .debug(isTestServer: true)
//        current = .debug(isTestServer: false)
    
        XXLogger.xx_DefaultLogLevel = .d
#endif

        doInitial()
    }
    
    static func doInitial(){
        
        var isTestServer = false
        
        switch current {
        case let .debug(isTestServer_):
            isTestServer = isTestServer_
        case let .release(isTestServer_):
            isTestServer = isTestServer_
        }
        
        AppURL.initialize(isTestServer: isTestServer)
    }
}
